package com.smart.campus.service.impl;

import com.smart.campus.dao.AttendanceTimeMapper;
import com.smart.campus.dto.AttendanceTime;
import com.smart.campus.service.AttendanceTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AttendanceTimeServiceImpl implements AttendanceTimeService {
    @Autowired
    private AttendanceTimeMapper attendanceTimeMapper;

    @Override
    public List<AttendanceTime> findList() {
        return attendanceTimeMapper.selectList(null);
    }

    @Override
    public void addAtt(AttendanceTime attendanceTime) {
        attendanceTimeMapper.insert(attendanceTime);
    }

    @Override
    public void delAtt(Integer id) {
        attendanceTimeMapper.deleteById(id);
    }

    @Override
    public AttendanceTime findAttById(Integer id) {
        return attendanceTimeMapper.selectById(id);
    }

    @Override
    public void update(AttendanceTime attendanceTime) {
        attendanceTimeMapper.updateById(attendanceTime);
    }
}
